﻿using ManageSystem.Model;
using ManageSystem.IRepository;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace ManageSystem.Repository
{
    public class OutlayStreamRepository: BaseRepository<OutlayStream>, IOutlayStreamRepository
    {
        public async Task<List<OutlayStream>> QueryOutlayByProjectGuid(string projectGuid)
        {
            return await Db.Queryable<OutlayStream>().Where(it => it.projectGuid == projectGuid).ToListAsync();
        }

        // 删除项目时删除与其相关的支出流水
        public async Task<int> DeleteOutlayStreamByProjectGuid(string projectGuid)
        {
            return await Db.Deleteable<OutlayStream>().Where(it => it.projectGuid == projectGuid).ExecuteCommandAsync();
        }
    }
}
